//package com.cdfahe.gms.web.controller;
//
//import java.util.Date;
//import java.util.List;
//import java.util.Map;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//
//import net.sf.json.JSONObject;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import sun.security.krb5.internal.HostAddress;
//
//import com.cdfahe.common.util.Md5Encode;
//import com.cdfahe.gms.aop.SysContent;
//import com.cdfahe.gms.mybatis.entity.DzGoodsTypeExample;
//import com.cdfahe.gms.mybatis.entity.DzShoppingHistory;
//import com.cdfahe.gms.mybatis.entity.DzUsersInfo;
//import com.cdfahe.gms.mybatis.entity.DzUsersInfoExample;
//import com.cdfahe.gms.mybatis.mapper.DzShoppingHistoryMapper;
//import com.cdfahe.gms.service.DzGoodsService;
//import com.cdfahe.gms.service.DzShoppingCartService;
//import com.cdfahe.gms.service.ShopHistoryService;
//import com.cdfahe.gms.service.UserService;
//
//
//
//@Controller("clientManageController")
//public class ClientManageController {
//	@Autowired
//	private DzGoodsService goodsService;
//	@Autowired
//	private DzShoppingCartService shoppingCartService;
//	@Autowired
//    private UserService userService;
//	@Autowired
//    private ShopHistoryService historyService;
//	
//    @Autowired
//	private  ShopHistoryService shopHistoryService;
//
//	    @RequestMapping(value = "addmoney")
//	    public String delGoodsFromShopCar(HttpServletRequest request,Model model) {
//	     	String userid = request.getParameter("userid");
//			if (userid == null || "".equals(userid)) {
//				userid = String.valueOf(SysContent.getRequest().getSession().getAttribute("userid"));
//			}
//			DzUsersInfo user = userService.getUserById(Integer.parseInt(userid));
//			model.addAttribute("user", user);
//			return "clientmanagepages/addmoney";
//	    }
//	    
//	    @RequestMapping(value = "/doaddmoney")
//	    public String addMoney(HttpServletRequest request,Model model) {
//	    	String userid = request.getParameter("userid");
//	    	String usermoney = request.getParameter("usermoney");
//	    	if (userid == null || "".equals(userid)) {
//				userid = String.valueOf(SysContent.getRequest().getSession().getAttribute("userid"));
//			}
//	    	if (userid == null || "".equals(userid)) {
//	    		return "login";
//	    	}
//	    	Float total = userService.getUserById(Integer.parseInt(userid)).getMoney() + Float.parseFloat(usermoney);
//	    	
//	    	DzUsersInfo example = new DzUsersInfo();
//	    	example.setId(Integer.parseInt(userid));
//	    	example.setMoney(total);
//	    	userService.updateUserById(example);
//	    	return "shoppages/myshophistory";
//	    }
//}
